// interface Monitor {}
// class Monitor27 implements Monitor {}

// interface Host {}
// class LegendHost implements Host {}
import { Monitor27, LegendHost, Monitor, Host } from "./2.ioc";
export class Computer {
  monitor: Monitor;
  host: Host;
  // 将具体的零件 通过参数传递
  constructor(monitor, host) {
    this.monitor = monitor;
    this.host = host;
  }
  start() {
    console.log("组装好了,可以开机了");
  }
}
// 类的外部实例化组件(零件),参数传递的方式  解决第一个问题
let monitor = new Monitor27();
let host = new LegendHost();

let computer = new Computer(monitor, host);
computer.start();
